 package com.book.demo;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.junit4.SpringRunner;

import com.book.service.itf.IndexServiceItf;

@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment=WebEnvironment.DEFINED_PORT)
public class BookWeb123TestRestTemplate {

	@Autowired
	IndexServiceItf indexService;
	
	@Autowired
	TestRestTemplate trt;
	
	@Test
	public void test_index2() throws Exception {
		 ResponseEntity<String> result = trt.getForEntity("/index2?name=[0]&pass=[1]",String.class,"admin","1" );
		
		System.out.println(result.getBody());
		
		
		
		
	}

}
